<article class="dialog login">
	<div class="panel login-panel">
		<a class="close" href="javascript:;"></a>
		<form action="{:U('User/login')}" class="login-form" autocomplete="off">
			<div class="form-group">
				<label class="input-addon phone"></label>
				<input class="form-control"  name="username"  type="text" placeholder="手机号">
			</div>
			<div class="form-group">
				<label class="input-addon key"></label>
				<input class="form-control" type="password" placeholder="密码" name="password">
			</div>
			<div class="form-group">
				<a class="btn ajax-post" href="javascript;;" target-form="login-form">登录</a>
			</div>
			<div class="form-group">
				<a class="forgotten fr" href="{:U('User/forgotten')}">忘记密码</a>
			</div>
			<div class="form-group elselogin">
				<label class="label-controls">其他登录方式：</label>
				<ul>
					<li><a href="#" title="QQ" class="login-icon qq">QQ</a></li>
					<li><a href="#" title="微信" class="login-icon weixin">微信</a></li>
					<li><a href="#" title="旺旺" class="login-icon wangwang">旺旺</a></li>
					<li><a href="#" title="微博" class="login-icon weibo">微博</a></li>
				</ul>
			</div>
			<div class="form-group">
				<p class="center" style="margin-top: 20px;">还没账号？<a href="javascript:;" class="opendialog register" dialog-form="register">立即注册</a></p>
			</div>
		</form>
	</div>
</article>
<article class="dialog register">
	<div class="panel register-panel">
		<a class="close" href="javascript:;"></a>
		<form action="{:U('User/register')}" class="register-form" autocomplete="off">
			<div class="form-group">
				<label class="input-addon phone"></label>
				<input class="form-control" name="username"  id="reg_username" type="text" placeholder="手机号">
			</div>
			<div class="form-group">
				<input class="form-control input-verify" name="verify" type="text" placeholder="验证码">
				<a href="javascript:;" class="btn message sendbtn">点击获取验证码</a>
			</div>
			<div class="form-group">
				<label class="input-addon key"></label>
				<input class="form-control" name="regpassword" type="password" placeholder="设置密码">
			</div>
			<div class="form-group">
				<label class="input-addon key"></label>
				<input class="form-control" name="regrepassword" type="password"  placeholder="重复密码">
			</div>
			<div class="form-group">
				<a class="btn ajax-post" href="javascript;;" target-form="register-form">注册</a>
			</div>
			<div class="form-group">
				<p class="center" style="margin-top: 20px;">我有账号？<a href="javascript:;" class="opendialog login" dialog-form="login">立即登录</a></p>
			</div>
		</form>
		<script type="text/javascript">
		var time = 120;		
		function btntext() {
			time--;
			
			if(time < 0) {
				time = 120;
				$('.sendbtn').text('点击获取验证码');
				$('.sendbtn').removeClass('disabled');
			} else {
				$('.sendbtn').text(time + '秒重新发送');
				setTimeout("btntext()", 1000);
			}
		}
		
		$(function(){
			$('.sendbtn').on('click', function(e){
				self = $(this);
				
				if (self.hasClass('disabled')) {
					return false;
				}
				
				self.addClass('disabled');
				
				$.post('{:U('send/message')}', 'method=register&mobile=' + encodeURIComponent($('#reg_username').val()), function(data){
					if (data.status) {
						$('.input-verify').val(data.code);
						self.val(time + '秒重新发送');
						setTimeout("btntext()", 1000);
					} else {
						updateAlert(data.info);
						self.removeClass('disabled');
					}
				}, "json");
			});
		});
		</script>
	</div>
</article>
<nav>
	<div class="container">
		<div class="fl login">
           <eq name="UID" value="0">
			<a href="javascript:;" class="opendialog" dialog-form="login">登录</a>
			<a href="javascript:;" class="opendialog" dialog-form="register">注册</a>
			<else />
			<a href="{:U('User/index')}">{:get_username(is_login())}</a>，聚真宝欢迎您！  
			<a href="{:U('User/logout')}" class="ajax-get">退出</a>
           </eq>
        </div>
        <ul class="fr tools">
        	<li><a href="{:U('Index/index')}" class="red">聚真宝首页</a></li>
        	<li><a href="{:U('Article/detail',array('id'=>27))}">了解聚真宝鉴定服务</a></li>
        	<li><a href="{:U('Identify/index')}">我的鉴定</a></li>
            <li><a href="{:U('User/index')}" class="arrow_down">我的聚真宝</a></li>
            <li><a href="{:U('order/carts')}">购物车</a></li>
            <li><a href="#">手机版</a></li>
            <li><a href="#">聚真宝社区</a></li>
            <li><a href="{:U('Business/index')}">卖家中心</a></li>
        </ul>
	</div>
</nav>